from sqlalchemy import Column, String, INTEGER, DateTime, Integer

from sqlConfig import Base


class Location(Base):
    __tablename__ = 'location'

    id = Column(Integer, primary_key=True, autoincrement=True)

    dormitoryId = Column(String(12), nullable=False)

    userId = Column(String(12), nullable=False)

    date = Column(DateTime(), nullable=False)

    def __init__(self, dormitoryId, userId, date):
        self.dormitoryId = dormitoryId
        self.userId = userId
        self.date = date
